package webserver;

import java.util.*;
public class HttpMessage {
	public String urlString;
	public String uristring;
	public String request_headString;
	public String contenttypeString;
	
	public HashMap request_headMap;
	public HashMap paramdataMap;
	
	public HttpMessage()
	{
		request_headMap = new HashMap();
		paramdataMap = new HashMap();
	}
	
	public void splitstatuline(String statulineString)
	{
		urlString = statulineString.split(" ")[1];
		//System.out.println("url:"+urlString);
		String[] tempStrings = urlString.split("\\?");
		uristring = tempStrings[0];//System.out.println("uri:"+uristring);
		//contenttypeString = uristring.split("\\.")[1];
		String[] parameterStrings = tempStrings[1].split("&");
		for(int i = 0;i<parameterStrings.length;i++)
		{
			String[] oneofparamStrings = parameterStrings[i].split("=");
			if(oneofparamStrings.length==2)
			paramdataMap.put(oneofparamStrings[0].toUpperCase(), oneofparamStrings[1]);
		}
		
	}
	
	
}
